package cn.xicode.cloud.frame.dubbo.provider.user;

import cn.xicode.cloud.frame.dubbo.common.provider.user.UserProvider;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;

/**
 * @author LGC
 * 不配置 protocol 默认使用配置文件所配置的协议，这里也可以指定协议
 */
@Slf4j
@DubboService
public class UserProviderImpl implements UserProvider {
    @Override
    public String getUsername() {
        RpcContext.getServerContext().setAttachment("cc", "bbb");
        log.info("服务端设置cc值到消费端 cc：{}", "bbb");
        return "helle user";
    }
}
